package demo;

import java.util.concurrent.Executors;

public class ExecutorDemo {
  public static void main(String[] args) {
    var executorService = Executors.newFixedThreadPool(3);

    var demo1 = executorService.submit(new Task());
    var demo2 = executorService.submit(new NewThread());

    executorService.shutdown();

    try {
      System.out.println("result of demo1 " + demo1.get());
      System.out.println("result of demo2 " + demo2.get());

    } catch (Exception e) {
      
    }
  }
}
